//
//  BaseViewController.m
//  Tour
//
//  Created by 张张烨 on 16/3/7.
//  Copyright © 2016年 张中烨. All rights reserved.
//

#import "BaseViewController.h"

@interface BaseViewController ()

@end

@implementation BaseViewController


- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    
//    self.view.backgroundColor = COLOR_BG;   //以后要改回来
//    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Mode"] isEqualToString:@"night"]) {
//        self.view.backgroundColor = COLOR_BTN_NIGHT;
//        
//    }
//    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeColor:) name:@"changeColor1" object:nil];
    
}

//改变颜色的方法
//- (void)changeColor:(NSNotification *)notification{
//    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Mode"] isEqualToString:@"night"]) {
//        self.view.backgroundColor = COLOR_NIGHT;
//    } else {
//        self.view.backgroundColor = COLOR_NORMAL;
//    }
//}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];

 


}

+ (void)saveCache:(int)type andID:(int)_id andDic:(NSDictionary *)dic
{
    NSUserDefaults *setting = [NSUserDefaults standardUserDefaults];
    NSString *key = [NSString stringWithFormat:@"detail-%d-%d", type, _id];
    [setting setObject:dic forKey:key];
    [setting synchronize];
}

+(NSDictionary *)getCache:(int)type andId:(int)_id
{
    NSUserDefaults *setting = [NSUserDefaults standardUserDefaults];
    NSString *key = [NSString stringWithFormat:@"detail-%d-%d", type, _id];
    NSDictionary *value = [setting objectForKey:key];
    return value;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
